package com.sinaapp.gavinzhang.GSpider.config;

import com.sinaapp.gavinzhang.GSpider.core.AbstractProcess;

/**
 * Created by gavin on 15-9-2.
 */
public class GSpiderConfig {
    /** 控制线程池数量*/
    private int controlExecutorNum;
    /** 任务线程池数量*/
    private int taskExecutorNum;

    /** 查找网址任务*/
    private AbstractProcess process;



    public static GSpiderConfig getDefaultConfig()
    {
        GSpiderConfig gSpiderConfig = new GSpiderConfig();
        gSpiderConfig.controlExecutorNum = Constants.CONTROL_EXECUTOR_NUM;
        gSpiderConfig.taskExecutorNum = Runtime.getRuntime().availableProcessors()*Constants.MULTI_THREAD_BASIC;
        gSpiderConfig.process = new com.sinaapp.gavinzhang.GSpider.process.Process();
        return gSpiderConfig;
    }

    public int getControlExecutorNum() {
        return controlExecutorNum;
    }

    public void setControlExecutorNum(int controlExecutorNum) {
        this.controlExecutorNum = controlExecutorNum;
    }

    public int getTaskExecutorNum() {
        return taskExecutorNum;
    }

    public void setTaskExecutorNum(int taskExecutorNum) {
        this.taskExecutorNum = taskExecutorNum;
    }

    public AbstractProcess getProcess() {
        return process;
    }

    public void setProcess(AbstractProcess process) {
        this.process = process;
    }
}
